<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>划题</title>
    <link rel="stylesheet" href="./canvas.css">
    <style>
        html,
        body {
            height: 100vh;
            margin: 0;
        }
    </style>
</head>

<body>
    <div id="painter">

    </div>
</body>
<script src="./jquery-1.12.4.min.js"></script>
<script src="./canvas.js"></script>
<script>
    $('#painter').setCanvas({
        question: './a.jpg',
		getBase64:function(imgData){
			console.log(imgData)
			var oA = document.createElement("a");
			oA.download = '';// 设置下载的文件名，默认是'下载'
			oA.href = imgData;
			document.body.appendChild(oA);
			oA.click();
			oA.remove(); // 下载之后把创建的元素删除
		}
    });
</script>

</html>